package com.ziyueyuwen.xiniao.service.baseservice.lesson;

import com.ziyueyuwen.xiniao.bean.ZyClassLessonInfo;
import com.ziyueyuwen.xiniao.bean.vo.ZyLessonVO;

import java.util.List;

/**
 * @author wancheng  on 2019/1/22.
 */
public interface ZyClassLessonService {
    /**
     * 主键获取
     * @param lessonId
     * @return
     */
    ZyClassLessonInfo getByPreKey(Integer lessonId);

    /**
     * 获取班级内所有的课节
     * @param classId
     * @return
     */
    List<ZyClassLessonInfo> getLessonByClassId(Integer classId);

    /**
     * 获取该学生在班级中的课节信息
     * @param classId
     * @param studentAccount
     * @return
     */
    List<ZyClassLessonInfo> getLessonByClassIdAndStudent(Integer classId,String studentAccount);

    /**
     * 获取插班课
     * @param classId
     * @param studentAccount
     * @return
     */
    List<ZyClassLessonInfo> getTransferLesson(Integer classId,String studentAccount);

    /**
     * 获取
     * @param classId
     * @param lessonIndex
     * @return
     */
    ZyClassLessonInfo getLesson(Integer classId,Integer lessonIndex);

    /**
     * 添加课节的基础方法,包括添加课节到出具库,同步eeo 生产该课节消息任务模板
     * @param lessonInfo
     * @throws Exception
     */
    void saveLesson(ZyClassLessonInfo lessonInfo) throws Exception;

    /**
     * 批量保存
     * @param lessonInfos
     * @param classId
     * @param teacherAccount
     * @param seatNum
     * @return 同步失败的课节
     * @throws Exception
     */
    List<ZyClassLessonInfo> saveLessonBatch(List<ZyClassLessonInfo> lessonInfos,Integer classId,String teacherAccount,Integer seatNum) throws Exception;

    /**
     * 修改课节
     * @param lesson
     * @param teacherAccount
     * @throws Exception
     */
    void updateLesson(ZyClassLessonInfo lesson,String teacherAccount) throws Exception;

    /**
     * 删除课节
     * @param lessonId
     */
    void deleteLesson(Integer lessonId);

    /**
     * 获取班级的最大课节数
     * @param classId
     * @return
     */
    Integer getMaxLessonIndex(Integer classId);

    /**
     * 获取已经上过的课节
     * @param classId
     * @return
     */
    List<ZyLessonVO> getLessonAlreadyUsed(Integer classId);

    /**
     * 未上过的课节
     * @param classId
     * @return
     */
    List<ZyLessonVO> getLessonUnUsed(Integer classId);
}
